package bishi.day05_4_22;

import java.util.Scanner;

public class hui_wen_shu {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            String A = sc.nextLine();
            String B = sc.nextLine();
            int len = A.length();
            int count = 0;
            for(int i = 0; i <= len; i++) {
                //*****注意取头和尾
                String tep = A.substring(0,i) + B + A.substring(i,len);
                if(helper(tep)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
    public static boolean helper(String str) {
        int l = 0;
        int r = str.length() - 1;
        while(l <= r) {
            if(str.charAt(l) != str.charAt(r)) {
                return false;
            }
            l++;
            r--;
        }
        return true;
    }
}
